#!/usr/bin/bash

IP_CCD0="192.168.0.110"
IP_CCD1="192.168.0.109"
IP_CCD2="192.168.0.108"
IP_CCD3="192.168.0.106"

##############################################################
# CCD0
echo "syncing configurations to MephistoBlue CCD0"
echo '0' > myidx.cfg
rsync -av myidx.cfg root@${IP_CCD0}:/sd/
rsync -av auto_start.sh root@${IP_CCD0}:/sd/
rsync -av -r bin root@${IP_CCD0}:/sd/
rsync -av -r params_250K_mosaic_blue0 root@${IP_CCD0}:/sd/
rsync -av -r params_500K_mosaic_blue0 root@${IP_CCD0}:/sd/
rsync -av -r params_900K_mosaic_blue0 root@${IP_CCD0}:/sd/
rsync -av -r params_2000K_mosaic_blue0 root@${IP_CCD0}:/sd/


##############################################################
# CCD1
echo "syncing configurations to MephistoBlue CCD1"
echo '1' > myidx.cfg
rsync -av myidx.cfg root@${IP_CCD1}:/sd/
rsync -av auto_start.sh root@${IP_CCD0}:/sd/
rsync -av -r bin root@${IP_CCD1}:/sd/
rsync -av -r params_250K_mosaic_blue1 root@${IP_CCD1}:/sd/
rsync -av -r params_500K_mosaic_blue1 root@${IP_CCD1}:/sd/
rsync -av -r params_900K_mosaic_blue1 root@${IP_CCD1}:/sd/
rsync -av -r params_2000K_mosaic_blue1 root@${IP_CCD1}:/sd/

##############################################################
# CCD2
echo "syncing configurations to MephistoBlue CCD2"
echo '2' > myidx.cfg
rsync -av myidx.cfg root@${IP_CCD2}:/sd/
rsync -av auto_start.sh root@${IP_CCD0}:/sd/
rsync -av -r bin root@${IP_CCD2}:/sd/
rsync -av -r params_250K_mosaic_blue2 root@${IP_CCD2}:/sd/
rsync -av -r params_500K_mosaic_blue2 root@${IP_CCD2}:/sd/
rsync -av -r params_900K_mosaic_blue2 root@${IP_CCD2}:/sd/
rsync -av -r params_2000K_mosaic_blue2 root@${IP_CCD2}:/sd/

##############################################################
# CCD3
echo "syncing configurations to MephistoBlue CCD3"
echo '3' > myidx.cfg
rsync -av myidx.cfg root@${IP_CCD3}:/sd/
rsync -av auto_start.sh root@${IP_CCD0}:/sd/
rsync -av -r bin root@${IP_CCD3}:/sd/
rsync -av -r params_250K_mosaic_blue3 root@${IP_CCD3}:/sd/
rsync -av -r params_500K_mosaic_blue3 root@${IP_CCD3}:/sd/
rsync -av -r params_900K_mosaic_blue3 root@${IP_CCD3}:/sd/
rsync -av -r params_2000K_mosaic_blue3 root@${IP_CCD3}:/sd/

